package io.renren.modules.app.controller;

import io.renren.common.utils.JsonResult;
import io.renren.common.utils.R;
import io.renren.modules.app.service.*;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;

/**
 * APP银行存款日记账
 *
 * @author baozhiqiang
 */
@RestController
@RequestMapping("/app")
@Api("APP报表，银行存款日记账接口")
public class AppReportBankaccController {

    //银行存款日记账报表bzq
    @Autowired
    private AppReportBankaccService reportBankaccWebService;
    //银行存款日记账报表首页
    @GetMapping("bankDepositTally")
    public R findPage( @RequestParam Map<String, Object> params ) {
         /*   IPage<Map<String, Object>> page = new Page<>(cur, pag);*/
        R pp =reportBankaccWebService.findPage( params );
        return pp;
    }

    //银行存款日记账首页总计bzq
    @Autowired
    private AppBankzjWebService bankzjWebService;
    @GetMapping("bankDepositTallyzj")
    /*@ApiOperation("忽略Token验证测试")*/
    public R bankzjWebService(String pkorg , String begindate , String enddate){

        R resultList = bankzjWebService.rebankzj(pkorg ,  begindate ,  enddate);
        return  resultList;
    }


    //银行存款日记账报表详情bzq
    @GetMapping("bankDepositAc")
    public R bankDepositAcWebService(@RequestParam Map<String, Object> params) {

        R pp =reportBankaccWebService.bankDepositAcWebService( params );
        return pp;
    }


    //银行存款日记账详情总计bzq
    @GetMapping("reportBankaDetailzj")
    /*@ApiOperation("忽略Token验证测试")*/
    public R reportBankaDetailzj(@RequestParam Map<String, Object> params){

        R resultList = reportBankaccWebService.reportBankaDetailzj(params);
        return  resultList;
    }

/*
    //银行存款日记账小计作废bzq
    @GetMapping("reportBankaDetailSub")
    */
/*@ApiOperation("忽略Token验证测试")*//*

    public R reportBankaDetailSubWebService(@RequestParam Map<String, Object> params){

        R resultList = reportBankaccWebService.reportBankaDetailSub(params);
        return  resultList;
    }
*/







    @GetMapping("orgorgs")
    /*@ApiOperation("财务组织")*/
    public R orgorgsWebService( String pkorg  ){

        R orgs = reportBankaccWebService.orgorgsWebService( pkorg );
        return  orgs;
    }

    @GetMapping("orgorgsAll")
    /*@ApiOperation("财务组织")*/
    public R orgorgsAll( String pkorg  ){

        R orgs = reportBankaccWebService.orgorgsAll( pkorg );
        return  orgs;
    }

    @GetMapping("orglike")
    /*@ApiOperation("财务组织模糊查询")*/
    public R selectOrgorgsWebService( String name , String pkorg ){

        String name_like = "%"+name +"%";

        R orgs = reportBankaccWebService.selectOrgorgsWebService( name_like ,pkorg );
        return  orgs;
    }


    @Autowired
    private AppCorpWebService corpWebService;

    @GetMapping("corpWebService")
    /*@ApiOperation("银行档案接口")*/
    public R corpWebService(){

        R corp = corpWebService.corpWebService();
        return  corp;
    }


//银行信息
    @Autowired
    private AppBankWebService bankWebService;

    @GetMapping("bankWebService")
    /*@ApiOperation("忽略Token验证测试")*/
    public JsonResult bankWebService(){

        JsonResult bank = bankWebService.bankWebService();
        return  bank;
    }

    @Autowired
    private AppPrimalAmountWebService primalAmountWebService;

    @GetMapping("primalAmountWebService")
    /*@ApiOperation("忽略Token验证测试")*/
    public JsonResult primalAmountWebService(){

        JsonResult primal = primalAmountWebService.primalAmountWebService();
        return  primal;
    }




    @Autowired
    private AppMoneyWebService appMoneyWebService;
    //资金周报
    @GetMapping("money")

    public R reportMoney( String pkorg , String begindate , String enddate  ){

        R reportMoney = appMoneyWebService.moneyReport( pkorg , begindate ,  enddate  );
        return  reportMoney;
    }

    @GetMapping("moneytbzq")

    public R moneytbzq( String year ){

        R reportMoney = appMoneyWebService.moneytbzq( year  );
        return  reportMoney;
    }



}
